pvs fix
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 23 Mar 2021 15:46:42 +0000 (09:46 -0600)
committertsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 23 Mar 2021 15:46:42 +0000 (09:46 -0600)
V668 There is no sense in testing the 'wpt_tmp' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error.

ozi.cc

diff --git a/ozi.cc b/ozi.cc
index c2a40890108e129801306d89abea19e625b4a036..4c30584094f429eda1c9ea1fc9c30a773b275ea2 100644 (file)
--- a/ozi.cc
+++ b/ozi.cc
@@ -822,13 +822,9 @@ data_read()
         }
         break;
       case rtedata:
-        if (linecount > 5 && wpt_tmp) {/* skipping over file header */
+        if ((linecount > 5) && !header) {/* skipping over file header */
           ozi_convert_datum(wpt_tmp);
-          if (!header) {
-            route_add_wpt(rte_head, wpt_tmp);
-          } else {
-            delete wpt_tmp;
-          }
+          route_add_wpt(rte_head, wpt_tmp);
         } else {
           delete wpt_tmp;
         }